# Contributor: Antoine Fontaine <antoine.fontaine@epfl.ch>
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=py3-janus
pkgver=1.1.0
pkgrel=0
pkgdesc="Mixed sync-async queue to interoperate between asyncio tasks and classic threads"
url="https://github.com/aio-libs/janus/"
arch="noarch"
license="Apache-2.0"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest py3-pytest-asyncio py3-pytest-cov"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/j/janus/janus-$pkgver.tar.gz"
builddir="$srcdir/janus-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
3ebfd325e64a249309b11e22790958e5e4643c76ac4bfb6c7dfeffb57046e6afcbe47b9a7e12a84a1bbfb1ec5960fd75127b051d19ad098d09b2ebd2a66aedeb  janus-1.1.0.tar.gz
"
